package cn.edu.cuit.alipay.config;

import java.io.FileWriter;
import java.io.IOException;


public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016100100641257";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDSv6qGqDxsnh1vW3qLEPcNiLPYY/E8ywWdw9PA/pztnYQsiZ9XNyejmZfcqT621t0rz86LS8omOuVYWhLeYMhVi7ARjBiVpIfkZCxoTsb5uNuAR1YaUT1uY6dKKS7weDhbewovAtVwIBtJKHwE+EQLapYAWgluyhDeqLHRvR7XV96/QC+DO2ywQOAGNIKqoG9IaJWQN0dFM9v3hGF7D40XNm86fsvb/oK7tXOgbalcsGOI0azk+gIIdSmkPSAkVlWAD23vejEtANa0jKBzraHRenP3K/ur9WtLwfDsM4po8rjn9FWVn8u+UrcFjCpEun8e9ra6MoscyuVPTtKBQ9eTAgMBAAECggEAR1ws8qGerCyxzNYN3W7mKIgEVZ4pvisEgNIhLnVIT9EJQ0dqU87SNjw4xrfsC18fzsjzqAkGrwE8TTlasD/XNdgxyw9D98+ZUAV3X+5kw4QLlxkQl6KwiWNm7t6ZDUW314oG/boY6XmFo7T4oXorGC6EEiRqk0AKjEpUw68k9UcnTYU17hoWmj4L27mDWLDv6vpcaidJijxkG4fj4h4crjmqX4wdCql0ZDw8D1ZO/h91/IbB38vO6/Hq4gQqozKERJ10C4LiHgUFJ4HlJ+VMc7VhKJlnaGo53EKMbqVxnTLMPBhY8QVpPPJ9nzpCCri+WkSFeqKmP/6uLWZWAr328QKBgQDrkKBDljXuy+YXftZkk4iWsBDnExStN/g7fbQF89MtXq2k5EvP/QNSjY90GWaiOLvrEP8sLaUpZxLRpE61SkYGxE27l/kPsXL+p8euM+N0Omh5zwCm4JdnUNIZUTAwfzAKBktHKf6xbVWc93wL9E4yw660UAtviZ21oFA8Bo20WwKBgQDlB+0jx9QY3Zk0XzSwsKMF/bU8V/gMWK42STNJixDficM24OHAKYW/vYw9e1k7KezstQByZ6SZajJg0Gy1UFe5DLKoSFuzOH4VXsqLlE9wuxOg3e1ht5BVU/UDlEzqJJcj9rUNtmQzPfIOGFrKB+W6QBeGklfrMjcpwMcDXmPvKQKBgQCIUSA9HF7Hep0DObYNa8beFLMjVUpg1wPCQYL88tVg6uongqlQigTzL9I1CEH5XEV6yVIxGZT7OZeNU7zscjfF0LF+/nn1l+WI8kS+TW6xot80phKlf1B+TCnY1r/BQMjm9C951hZ6TF//vsO9EzpxbAXceHm1qPhn04a6xbwZAwKBgCphSBlJ3c5oGvRc9aQIW3I9Wy76XDT0p+/1pZ7jM9EZbd0Wyc9EH7K2QWATFhTjkirO53FECmo1A3N0vdjjMAhW+Cw5j3Zfar1LmBEx9W03wM8Qod9mFzgi3AC4jW76LFmESkZqTKpKuSKwkQQ3Z+QJ/hBxvgEQfrKkMG9IJRfZAoGAZJyhvfJ159IeX4ltyOPsobHQEtH3pwNtemOLNJ4sLs3O+qoNlBQOJ+0NrDoZRUjk2USuB9KsyrKaUmPNM+uuyinEVuZdoOhMvAOHtGCG4lh8/YJddyXoV3yCC7sf80f7TN4pwEltoon0iG96LkL7svb1jFMDXDlzEY2tB/C1piQ=";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvpD81NkDtGXYcylyvxH5gpGYFxyEJDo5fIU4GaBYch6C/IaBh/QqzoQgzLzPB6+LpJpcbPQxjSk65JvnrSc5AhQxlBdXyj3L6pkyLf6FF+YGnczqaQvHYlPeIcJS7W37sHSssJKo14ZL/5yS06km/CItQm/xp3wSe3gP7m8Xo8b/y+CD1uxU9ZA4Fv1dBgzrhglgCHqzHbJyZlJSAQRZJoAckBHWmWXzedXlOxywcTAi1rkGZSCx5DiL9PCVXYemXiuXjx+XvvTDKKOdVTxvrV6Z1QGCh8u+zR7yJTI0bV/u9+x9TG63y6cD+QOP2EUoAzIf32BhtAlkHAa80+JDqQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/aumalls-controller/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/aumalls-controller/return_url";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

